QT       += core gui network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++20

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    ChatDialog/chatpage.cpp \
    ChatDialog/chatuserlist.cpp \
    ChatDialog/chatuserwid.cpp \
    ChatDialog/chatview.cpp \
    ChatDialog/customizeedit.cpp \
    ChatDialog/listitembase.cpp \
    ChatDialog/chatdialog.cpp \
    ChatDialog/loadingdlg.cpp \
    HttpMgr.cpp \
    # usermgr.cpp
    clickedbtn.cpp \
    clickedlabel.cpp \
    global.cpp \
    logindialog.cpp \
    main.cpp \
    mainwindow.cpp \
    registerdialog.cpp \
    resetdialog.cpp \
    tcpmgr.cpp \
    timerbtn.cpp \
    usermgr.cpp


HEADERS += \
    ChatDialog/chatpage.h \
    ChatDialog/chatuserlist.h \
    ChatDialog/chatuserwid.h \
    ChatDialog/chatview.h \
    ChatDialog/customizeedit.h \
    ChatDialog/listitembase.h \
    ChatDialog/chatdialog.h \
    ChatDialog/loadingdlg.h \
    HttpMgr.h \
    clickedbtn.h \
    clickedlabel.h \
    global.h \
    logindialog.h \
    mainwindow.h \
    registerdialog.h \
    resetdialog.h \
    singleton.h \
    tcpmgr.h \
    timerbtn.h \
    usermgr.h \
    ui_chatdialog.h \
    ui_chatuserwid.h \
    ui_logindialog.h \
    ui_mainwindow.h \
    ui_registerdialog.h \
    ui_resetdialog.h \


FORMS += \
    ChatDialog/chatdialog.ui \
    ChatDialog/chatpage.ui \
    ChatDialog/chatuserwid.ui \
    ChatDialog/chatview.ui \
    ChatDialog/loadingdlg.ui \
    logindialog.ui \
    mainwindow.ui \
    registerdialog.ui \
    resetdialog.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

# QMainWindow 界面的图标
RC_ICONS = icon.ico
DESTDIR = ./bin

RESOURCES += \
    rc.qrc \


DISTFILES += \
    res/add_friend_hover.png \
    res/add_friend_normal.png \
    res/addtip.png \
    res/arowdown.png \
    res/chat_icon.png \
    res/chat_icon_hover.png \
    res/chat_icon_press.png \
    res/chat_icon_select_hover.png \
    res/chat_icon_select_press.png \
    res/close_search.png \
    res/close_transparent.png \
    res/contact_list.png \
    res/contact_list_hover.png \
    res/contact_list_press.png \
    res/filedir.png \
    res/filedir_hover.png \
    res/filedir_press.png \
    res/head_1.jpg \
    res/head_2.jpg \
    res/head_3.jpg \
    res/head_4.jpg \
    res/head_5.jpg \
    res/ice.png \
    res/loading.gif \
    res/person.jpg \
    res/right_tip.png \
    res/search.png \
    res/smile.png \
    res/smile_hover.png \
    res/smile_press.png \
    res/tipclose.png \
    res/unvisible.png \
    res/unvisible_hover.png \
    res/visible.png \
    res/visible_hover.png \
    style/stylesheet.qss \
    style/stylesheet1.qss

win32:CONFIG(release, debug | release)
{
    #指定要拷贝的文件目录为工程目录下release目录下的所有dll、lib文件，例如工程目录在D:\QT\Test
    #PWD就为D:/QT/Test，DllFile = D:/QT/Test/release/*.dll
    TargetConfig = $${PWD}/config.ini
    #将输入目录中的"/"替换为"\"
    TargetConfig = $$replace(TargetConfig, /, \\)
    #将输出目录中的"/"替换为"\"
    OutputDir =  $${OUT_PWD}/$${DESTDIR}
    OutputDir = $$replace(OutputDir, /, \\)
    #执行copy命令
    QMAKE_POST_LINK += copy /Y \"$$TargetConfig\" \"$$OutputDir\"
}
